part of 'widget.dart';

class _TileTextButtonView extends StatelessWidget {
  const _TileTextButtonView({
    required this.title,
    required this.backgroundColor,
    required this.textColor,
    required this.onPressed,
  });

  final String title;
  final Color backgroundColor;
  final Color textColor;
  final VoidCallback onPressed;

  @override
  Widget build(BuildContext context) {
    final titleTextStyle = _TileTextButtonTheme.of(context).textTheme.title.copyWith(
          color: textColor,
        );

    return AppButton(
      onPressed: onPressed,
      borderRadius: BorderRadius.circular(5.0),
      color: backgroundColor,
      padding: const EdgeInsets.symmetric(
        horizontal: 10,
      ),
      child: SizedBox(
        height: 20,
        child: Center(
          child: Text(
            title,
            style: titleTextStyle,
            textAlign: TextAlign.center,
            textWidthBasis: TextWidthBasis.longestLine,
            maxLines: 1,
          ),
        ),
      ),
    );
  }
}
